Project 4: Introduction to Greenfoot
CS 110 •
20 Points Total
Due on-line Mon. Apr. 16, 2018
Objectives
- Install Greenfoot.
- Become familiar with Greenfoot scenarios.
- Practice object-oriented programming.
Preparation
Download and install the "Greenfoot" development kit from
http://www.greenfoot.org/
.
Click on "Enter the Greenfoot site", then click on "Download".
Help with
installing Greenfoot can be found by working with our Peer TA (Daniel). Also, review:
the Greenfoot tutorials by scrolling down to "Tutorials"
It is strongly suggested you review these tutorials.
The scenarios we use in class can be found at
https://www.greenfoot.org/book/
and look for the link to the "book scenarios" zip file then save the file.
The following sections describe what you need to do in each scenario.
Greenfoot uses many of the same ideas as Alice but has slightly different syntax!
Run Scenarios
Wombat Scenario
- Open the "Wombats" scenario by clicking on the scenario button in the tool bar (should be defaulted
but if not, find the wombat scenario).
- Right click on the wombat actor and click on "new wombat".
- Place the wombat anywhere you would like on the grid.
- Click on the "run" button to see what action the wombat does.
- Using the same technique, add multiple leaves to the scenario.
- Click on the "run" button again and see what the wombat does.
- Go ahead and add as many wombats and leaves as you want.
- Take a screen capture (alt-print screen on a PC) photo of a good moment in your Wombat Scenario and
save it in a Word document for your project report.
- Right click on "wombat" and select "open editor". Copy-paste (or take a screen capture) of the wombat
(Java) source code displayed for your project report.
Another Scenario
Pick another scenario of your choice. One I like is called "Lunarlander". Another fun one is "Turtle Graphics".
These two scenarios usually download when you install Greenfoot. Another option is to go the Greenfort.org
web site and download a scenario of a subject (e.g. a game) that interests you.
- Click on the "scenario" button in the toolbar and open up the scenario.
- Click on the "run" button located at the bottom and watch what happens.
- See if you can figure out how to add an object to this scenario. Right click
on the "actor" button and select "a new subclass".
- Pick a category in the "image categories" and find what object you want to add. Give this object a
"new class name" and press OK.
- For some earlier versions of Greenfoot, you might see the item with some grey stripes surrounding the picture.
At the bottom of the screen press the "compile all" button and watch the grey stripes disappear (you need to do this
so you can use the object in the scenario). For newer versions of Greenfoot, the compile step is automatic.
Now using from what you learned in the wombat scenario, add the object to the scenario.
- Take a screen capture photo of a good moment in your scenario and save it in a Word
document for your project report.
Project Report
Create a project report with screen shots documenting what you did and any observations you have.
Clearly label your sections of the report. Include the cover page as described below:
Project 4: Introduction to Greenfoot
Your Name
date handed in
CS 110
Upload into Blackboard Learn by the due date. Remember the filenaming convention of
Lastname_Firstname_Proj4.docx or something similar.